OtpFieldColors
Colors of an OtpField, created with OtpFieldDefaults.colors. Use dynamic colors (the defaults are) so dark mode and Increase Contrast keep working. Checked pairs, resolved for the trait collection in use (opaque colors only; masked OtpMask.FilledCell cells use the border colors):
text and errorText against cellBackground, 4.5:1 (WCAG 1.4.3);
cellBorder, focusedCellBorder, errorCellBorder and placeholder against cellBackground, 3:1 (WCAG 1.4.11);
focusedCellBorder against cellBorder, 3:1 (WCAG 2.4.13).
Violations are logged once and listed in contrastWarnings but never thrown, so brand colors remain usable. Disabled colors are exempt.
Properties
Functions
Link copied to clipboard
Contrast problems when the colors are resolved for traits, for example dark mode or Increase Contrast.